import type { HomeList, HopeList, cateList} from "@/types/home"
import { httpYX ,instance} from "@/utils/requestYX"

// 获取首页列表数据

export const reqHomeListInfo = () => {
    return httpYX<HomeList>('/xhr/index.json','GET')
}

// 获取商品类列表数据
export const reqHopeList = (params:any) =>{
    return httpYX<HopeList>('/xhr/index/items.json','POST', params)
}

// 获取商品分类数据
export const reqCateList = () =>{
    return httpYX<cateList>('/item/cateList.json','GET')
}

// 获取二级商品分类数据
export const reqCate2List = (id : number) =>{
    return httpYX<any>( `item/list.json?categoryId=${id}`,'GET')
}